package com.sentinel.demo03.service;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.stereotype.Service;

@Service
public class HelloService {
    @SentinelResource(value="sayHi-service",blockHandler = "sayHiDegrade")
    public String sayHi(String name) {
        return "Hello "+name+";i am sentinel";
    }
    public String sayHiDegrade(String name, BlockException blockException) {
        return "熔断处理了当前业务方法sayHi";
    }
}
